import { defineStore } from "pinia";

export const useCounterStore = defineStore("counter", {
  state: () => {
    return {
      count: 5,
    };
  },
  getters: {
    doubleCount(state) {
      return state.count * 2;
    },
    tripleCount: (state) => state.count * 3,
    tenTimesCount(): number {
      return this.count * 10;
    },
  },
  actions: {
    multiply(v: number) {
      this.count = this.count * v;
    },
  },
});
